package com.tjetc.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Classify {
    @Id
    @Field(type = FieldType.Text,store = true,index = true)
    private String ids;
    @Field(type = FieldType.Text,store = true,index = true,analyzer = "ik_max_word")
    private String title;
    @Field(type = FieldType.Text,store = true,index = true,analyzer = "ik_max_word")
    private String names;
    @Field(type = FieldType.Text,store = true,index = true)
    private String photos;
    @Field(type = FieldType.Text,store = true,index = true)
    private String prices;
    @Field(type = FieldType.Text,store = true,index = true)
    private String city;
    @Field(type = FieldType.Text,store = true,index = true,analyzer = "ik_max_word")
    private String address;
    @Field(type = FieldType.Text,store = true,index = true,analyzer = "ik_max_word")
    private String classify;
    @JsonFormat(pattern ="yyyy-MM-dd HH:mm",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @Field(type = FieldType.Text,store = true,index = true)
    private String times;
    @Field(type = FieldType.Text,store = true,index = true)
    private String states;
}
